﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsCommonStorage
{
    public enum CommonFileAttributes
    {
        Normal,
        ReadOnly,
        Directory,
        Archive,
        Temporary
    }

#if NETFX_CORE || WINDOWS_PHONE

    internal static class CommonFileAttributesExchanger
    {
        internal static Windows.Storage.FileAttributes Exchange(CommonFileAttributes attributes)
        {
            switch (attributes)
            {
                case CommonFileAttributes.Normal:
                    return Windows.Storage.FileAttributes.Normal;

                case CommonFileAttributes.ReadOnly:
                    return Windows.Storage.FileAttributes.ReadOnly;

                case CommonFileAttributes.Directory:
                    return Windows.Storage.FileAttributes.Directory;

                case CommonFileAttributes.Archive:
                    return Windows.Storage.FileAttributes.Archive;

                case CommonFileAttributes.Temporary:
                    return Windows.Storage.FileAttributes.Temporary;

                default:
                    return Windows.Storage.FileAttributes.Normal;
            }
        }

        internal static CommonFileAttributes Exchange(Windows.Storage.FileAttributes attributes)
        {
            switch (attributes)
            {

                case  Windows.Storage.FileAttributes.Normal:
                    return CommonFileAttributes.Normal;

                case Windows.Storage.FileAttributes.ReadOnly:
                    return CommonFileAttributes.ReadOnly;

                case Windows.Storage.FileAttributes.Directory:
                    return CommonFileAttributes.Directory;


                case  Windows.Storage.FileAttributes.Archive:
                    return CommonFileAttributes.Archive;


                case Windows.Storage.FileAttributes.Temporary:
                    return CommonFileAttributes.Temporary;

                default:
                    return CommonFileAttributes.Normal;



            }
        }
    }

#else
    internal static class CommonFileAttributesExchanger
    {
        internal static System.IO.FileAttributes Exchange(CommonFileAttributes attributes)
        {
            switch (attributes)
            {
                case CommonFileAttributes.Normal:
                    return System.IO.FileAttributes.Normal;

                case CommonFileAttributes.ReadOnly:
                    return System.IO.FileAttributes.ReadOnly;

                case CommonFileAttributes.Directory:
                    return System.IO.FileAttributes.Directory;

                case CommonFileAttributes.Archive:
                    return System.IO.FileAttributes.Archive;

                case CommonFileAttributes.Temporary:
                    return System.IO.FileAttributes.Temporary;

                default:
                    return System.IO.FileAttributes.Normal;
            }
        }
        internal static CommonFileAttributes Exchange(System.IO.FileAttributes attributes)
        {
            switch (attributes)
            {

                case System.IO.FileAttributes.Normal:
                    return CommonFileAttributes.Normal;

                case System.IO.FileAttributes.ReadOnly:
                    return CommonFileAttributes.ReadOnly;

                case System.IO.FileAttributes.Directory:
                    return CommonFileAttributes.Directory;


                case System.IO.FileAttributes.Archive:
                    return CommonFileAttributes.Archive;


                case System.IO.FileAttributes.Temporary:
                    return CommonFileAttributes.Temporary;

                default:
                    return CommonFileAttributes.Normal;



            }
        }

    }

#endif
}
